
package com.example.mam.util;


import com.example.mam.constant.Constant;

public class Condition {

    //请求当前页
    private Integer curPage = Constant.currentPage;
    //查询起始位置
    private Integer offset;
    //每一页显示多少
    private Integer pageSize = Constant.pageSize;
    // 查询结果接总数
    private  Integer total;


    public Condition() {
        this.offset = (curPage - 1)* pageSize;
    }

    public Integer getCurPage() {
        return curPage;
    }

    public void setCurPage(Integer curPage) {
        this.curPage = curPage;
        this.offset = (curPage - 1)* pageSize;
    }

    public Integer getOffset() {
        return offset;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
        this.offset = (curPage - 1)* pageSize;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    @Override
    public String toString() {
        return "Condition{" +
                "curPage=" + curPage +
                ", offset=" + offset +
                ", pageSize=" + pageSize +
                ", total=" + total +
                '}';
    }
}
